#include "seg.h"

unsigned char seg_dula[17] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};
unsigned char seg_wela[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
void Seg_disp(unsigned char wela,unsigned char dula,unsigned char point)
{
	P0 = 0xff;//共阳极消影
	P2 = P2& 0x1f |0xc0;
	P2 &= 0x1f;
	
	P0 = seg_wela[wela];//位选
	P2 = P2& 0x1f |0xc0;
	P2 &= 0x1f;
	
	P0 = seg_dula[dula];
	if(point)
		P0 &= 0x7f;
	P2 = P2& 0x1f |0xc0;
	P2 &= 0x1f;
}